Add warning when using HTTP Basic authentication#185
Open
BlocksecPHD wants to merge 1 commit intoDMTF:mainfrom
Open
Add warning when using HTTP Basic authentication#185BlocksecPHD wants to merge 1 commit intoDMTF:mainfrom
BlocksecPHD wants to merge 1 commit intoDMTF:mainfrom
Conversation
Issue: DMTF#183 When users authenticate with HTTP Basic auth, emit a UserWarning with guidance from the Redfish specification: - Security concerns highlighted by IETF (RFC7617) - Recommendation to use session management for improved performance and security - HTTPBasicAuth property in AccountService resource can restrict/disable this functionality This helps users understand the trade-offs of basic auth vs session-based authentication.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When using HTTP Basic authentication, the library does not inform users about the security and performance implications. As noted in issue #183, HTTP Basic auth has concerns documented in RFC7617, and sends credentials on each request, which impacts both security and performance compared to session-based authentication.
Changes
This PR adds a
UserWarningwhenAuthMethod.BASICis used during login, using language from the Redfish specification:Files Modified
src/redfish/rest/v1.py: Addedwarnings.warn()call in thelogin()method whenauth == AuthMethod.BASICtests/rest/test_v1.py: Added testtest_basic_auth_emits_warningto verify the warning is emitted with correct contentTest Results
All other existing tests continue to pass. The one pre-existing failing test (
test_redfish_client) was already failing before this change due to network behavior with mock URLs.References